import unittest
import json
{{resolver.py_include_statement(path)}}

class Test{{Name|UpperCamelCase}}{{objType|UpperCamelCase}}Structure(unittest.TestCase):
    """A test for the following schema:
    {{schema}}
    """
    
    def do_{{Name|snake_case}}_load(self, json_example_string):
        ex = json.loads(json_example_string)
        {{resolver.py_class_name(path)}}(ex)

    def test_parse_json(self):
        examples = [{%for example in examples%}
            ## Example Index {{loop.index - 1}}
            '{{example}}',
        {%endfor%}]
        for i, ex_str in enumerate(examples):
            with self.subTest(index=i):
                self.do_{{Name|snake_case}}_load(ex_str)

    def test_fail_when_not_json(self):
        example = 'this string here should cause it to fail{{examples[-1]}}'
        with self.assertRaises(ValueError):
            self.do_{{Name|snake_case}}_load(example)
{# #}